import { Component } from "react"
import Son from './components/son'
class App extends Component {
  state = {
    money: 10,
    getMoney: () => {
      console.log('父组件传过来的值', this.state.money)
    },
    changeMoney: (data) => {
      console.log('子组件要修改的值', data)

      this.setState({
        money: data
      })
    }
  }

  render () {
    return (
      <div>
        <h1>父组件{this.state.money}</h1>
        <Son getMoney={this.state.getMoney} changeMoney={this.state.changeMoney}></Son>
      </div>
    )
  }
}
export default App